package com.hcms.admin.dto;

import cn.hutool.core.bean.BeanUtil;
import com.hcms.common.util.TreeNode;
import com.hcms.mybatis.entity.SysMenu;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysMenuTreeResponse implements Serializable, TreeNode<SysMenuTreeResponse, Long> {

    private Long id;

    private Long parentId;

    private Integer menuType;

    private String path;

    private String component;

    private String name;

    private String redirect;

    private String metaTitle;

    private String metaIcon;

    private Integer metaHidden;

    private Integer metaAlwaysShow;

    private String metaPerms;

    private Integer metaKeepAlive;

    private Integer sort;

    private String remark;

    private String perm;

    private Date createTime;

    private List<SysMenuTreeResponse> children;

    public SysMenuTreeResponse(SysMenu menu) {
        BeanUtil.copyProperties(menu, this);
    }

}
